package com.updesignsz.admin.vo.form;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class RoleForm implements Serializable {
    private static final long serialVersionUID = -2186272458950017006L;

    @NotNull(message = "角色ID不能为空", groups = PutMapping.class)
    private Integer id;

    @NotBlank(message = "角色名不能为空", groups = {PostMapping.class, PutMapping.class})
    private String name;

    @NotBlank(message = "角色标识不能为空", groups = {PostMapping.class})
    private String identifier;

    private List<Integer> functions;
}
